<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/admin/public/head.jsp"%>

<html>
<script type="text/javascript">

//处理键盘事件  
function doKey(e){  
    var ev = e || window.event;//获取event对象  
    var obj = ev.target || ev.srcElement;//获取事件源  
    var t = obj.type || obj.getAttribute('type');//获取事件源类型  
    if(ev.keyCode == 8 && t != "password" && t != "text" && t != "textarea"){  
    	
    	var id="load_js";
		var title="温馨提示";
		var info="确定退出商家系统吗?";
		var href="####";
		var btnleft="确定";
		var btnright="取消";
		var noplayer=
			'<div id="'+id+'" class="modal">' +
				 '<div class="modal-header">' +
					 '<button class="close over" type="button">×</button>' +
					 '<h3>'+title+'</h3>' +
				 '</div>' +
				 '<div class="modal-body">'+
					 '<p>'+info+'</p>'+
				 '</div>'+
				 '<div class="modal-footer"> <button class="btn over" onclick=window.location.href="'+CTX+'/shopadmin/Login/loginOut.do">'+btnleft+'</button>  <button class="btn over">'+btnright+'</button> </div>'+
			'</div>';
		$(noplayer).appendTo("body");
		$("<div class='modal-backdrop in'></div>").appendTo("body");
		$("#"+id).find(".over").click(function(){
			$("#"+id).remove();	
			$("body .modal-backdrop").remove();	
		});
        return false;  
    }  
    if(ev.keyCode ==116){  
    	
    	//alert("F5");
        //return false;  
    } 
}  
//禁止后退键 作用于Firefox、Opera  
document.onkeypress=doKey;  
//禁止后退键  作用于IE、Chrome  
document.onkeydown=doKey;  

</script>


<body>
<input id="session_shopid" type="hidden" value="${sessionScope._SESSION_USER_.shopId}" />
<input id="session_shopname" type="hidden" value="${sessionScope._SESSION_USER_.shopName}" />


<!--Header-part--> 
<div id="header">
  <h1><a href="#">云便利商店</a></h1>
</div>
<h2 style="color:#fff; position:absolute; top:1px; left:200px; font-size:24px">商家后台</h2>
<!--close-Header-part--> 
<div id="alert-tips" ></div>

<!--top-Header-menu-->
<div id="user-nav" class="navbar navbar-inverse">
  <ul class="nav">
  	<li id="autoLi" style="display:none;">
  		<a title="" href="#" onclick="setAuto()"> <span class="text" id="isOpen">关闭自动打印订单</span></a>
  	</li>
  	<li  class="dropdown" id="autoLiSetting"  style="display:none;">
  		<a title="" href="#" data-toggle="dropdown" class="dropdown-toggle"> 
  		<span class="text" id="_print_type_">
  		<c:choose>
  			<c:when test="${sessionScope._SESSION_USER_.shopPrintType=='1'}">只打印商户联</c:when>
  			<c:when test="${sessionScope._SESSION_USER_.shopPrintType=='2'}">只打印客户联</c:when>
  			<c:when test="${sessionScope._SESSION_USER_.shopPrintType=='3'}">打印商户和客户联</c:when>
  			<c:otherwise>打印设置</c:otherwise>
  		</c:choose>
  		</span><b class="caret"></b></a>
  		 <ul class="dropdown-menu">
	        <li onclick="setPrintType(1,'只打印商户联')" style="cursor: pointer;">只打印商户联</li>
	        <li onclick="setPrintType(2,'只打印客户联')" style="cursor: pointer;">只打印客户联</li>
	        <li onclick="setPrintType(3,'打印商户和客户联')" style="cursor: pointer;">打印商户和客户联</li>
	      </ul>
  	</li>
    <li class=""><a title="" href="javascript:gotoSCM()" ><span class="text">供应商城</span></a></li>
  	
  	
    <li class=""><a title="" href="${ctx}/v1/pages/index.jsp"><span class="text">返回商城</span></a></li>
    <li class="dropdown" id="profile-messages" ><a href="#" data-target="#profile-messages" class="dropdown-toggle"><i class="icon icon-user"></i><span class="text"> 您好，${sessionScope._SESSION_USER_.userName}，${sessionScope._SESSION_USER_.shopName}</span></a>
     <!--  <ul class="dropdown-menu">
        <li><a href="#"><i class="icon-user"></i>我的店铺</a></li>
        <li class="divider"></li>
        <li><a href="#"><i class="icon-check"></i> 我的工作</a></li>
        <li class="divider"></li>
        <li><a href="login.html"><i class="icon-key"></i> 退出</a></li>
      </ul> -->
    </li>
    <li style="display:none;" class="dropdown" id="menu-messages"><a href="#" data-toggle="dropdown" data-target="#menu-messages" class="dropdown-toggle"><i class="icon icon-envelope"></i> <span class="text">消息</span> <span class="label label-important">5</span> <b class="caret"></b></a>
      <ul class="dropdown-menu">
        <li><a class="sAdd" title="" href="#"><i class="icon-plus"></i> 新消息</a></li>
        <li class="divider"></li>
        <li><a class="sInbox" title="" href="#"><i class="icon-envelope"></i> 收件箱</a></li>
        <li class="divider"></li>
        <li><a class="sOutbox" title="" href="#"><i class="icon-arrow-up"></i> 发件箱</a></li>
        <li class="divider"></li>
        <li><a class="sTrash" title="" href="#"><i class="icon-trash"></i> 回收站</a></li>
      </ul>
    </li>
    <li style="display:none;" class=""><a title="" href="#"><i class="icon icon-cog"></i> <span class="text">设置</span></a></li>
    <li class=""><a title="" href="${ctx}/shopadmin/Login/loginOut.do"><i class="icon icon-share-alt"></i> <span class="text">退出</span></a></li>
  </ul>
</div>
<!--close-top-Header-menu-->
<!--start-top-serch-->
<div style="display:none;" id="search">
  <input type="text" placeholder="搜索"/>
  <button type="submit" class="tip-bottom" title="Search"><i class="icon-search icon-white"></i></button>
</div>
<!--close-top-serch-->
<!--sidebar-menu
<div id="sidebar"><a href="#" class="visible-phone"><i class="icon icon-home"></i> 首页</a>
  <ul>
    <li class="active"><a href="javascript:load(ddf.index.index_js,1,'$ddf_index.loadIndex','')"><i class="icon icon-home"></i> <span>首页</span></a> </li>
    <li> <a href="javascript:load(ddf.order.order_js,3,'$ddf_order.loadOrderList','')"><i class="icon icon-pencil"></i> <span>订单管理</span></a> </li>   
    <li> <a href="javascript:load(ddf.merchandise.merchandise_js,4,'$ddf_merchandise.loadMerchandiseList','')"><i class="icon icon-inbox"></i> <span>商品管理</span></a> </li>    
    <li class="submenu"> <a href="#"><i class="icon icon-cogs"></i> <span>商店操作</span> <span class="label label-important ie_top">3</span></a>
      <ul>
        <li><a href="javascript:load(ddf.member.member_js,6,'$ddf_member.loadMemberList','')">会员查询</a></li>
        <li><a href="javascript:load(ddf.shop.shop_js,2,'$ddf_shop.loadShopDetail','')">基本信息</a></li>
      </ul>
    </li>
    <li><a href="javascript:load(ddf.account.account_js,2,'$ddf_account.loadAccountList','')"><i class="icon icon-tint"></i> <span>账户流水</span></a></li>
    <li><a href="javascript:load(ddf.withdraw.withdraw_js,4,'$ddf_withdraw.loadWithdrawList','')"><i class="icon icon-credit-card"></i> <span>提现</span></a></li> 
    <li><a href="javascript:load(ddf.withdraw.withdrawSettle_js,1,'$ddf_withdrawSettle.loadWithdrawSettleList','')"><i class="icon icon-money"></i> <span id="withdrawSettleSpan">提现记录</span></a></li>
    <li><a href="javascript:load(ddf.log.terminalLog_js,1,'$ddf_terminalLogs.loadqueryTerminalLogsList','')"><i class="icon icon-calendar"></i> <span>日志记录</span></a></li>
    <li><a href="queryProfit.html"><i class="icon icon-bar-chart"></i> <span>营业报表</span></a></li>
    <li class="submenu"> <a href="#"><i class="icon icon-user-md"></i> <span>店长操作</span> <span class="label label-important ie_top">5</span></a>
      <ul>
        <li><a href="javascript:load(ddf.bank.bank_js,2,'$ddf_bank.loadBankList','')">银行账户</a></li>
        <li><a href="javascript:load(ddf.terminal.terminal_js,1,'$ddf_terminal.loadTerminalList','')">设备监控</a></li>
        <li><a href="javascript:load(ddf.operator.operator_js,1,'$ddf_operator.loadOperatorList','')">操作员查询</a></li>
        <li><a href="javascript:load(ddf.safeSet.safeSet_js,4,'$ddf_safeSet.openSafeSetPage','')">安全设置</a></li>
      </ul>
    </li>
  </ul>
</div>
-->
<!--sidebar-menu -->
 <div id="sidebar"><a href="${ctx}/index.jsp" class="visible-phone"><i class="icon icon-home"></i> 首页</a>
  <ul id="menuList">                                   
    
  </ul>
</div>
<!--main-container-part-->
<div id="content">
  
</div>

<!--end-main-container-part-->

<!--Footer-part-->

<div class="row-fluid clearfix">
  <div id="footer" class="span12"> Copyright © 2011-2013 广州欧凌建材有限公司 版权所有 </div>
</div>

<script type="text/javascript" src="${ctx}/admin/js/base/jquery.min.js"></script> 
<script type="text/javascript" src="${ctx}/admin/js/base/sea.js"></script> 
<script type="text/javascript" src="${ctx}/admin/js/base/LodopFuncs.js"></script> 
<script type="text/javascript" src="${ctx}/admin/js/zTree/js/jquery.ztree.core-3.5.js"></script> 
<script type="text/javascript" src="${ctx}/admin/js/zTree/js/jquery.ztree.exedit-3.5.js"></script> 
<script type="text/javascript" src="${ctx}/admin/js/base/get2post.js"></script> 

<script type="text/javascript">

seajs.use(['component-core.js','autoPrint.js'],function(base,auto){
	 //加载首页内容
	 load(CTX+"/admin/shop/js/index/index.js");
	 
	 if(isInstalledLodop()){
		 $("#autoLi").css("display", "");
		 $("#autoLiSetting").css("display", "");
		 
		//自动打印订单
		auto.init(auto);
	 }else{
		 $("#autoLi").css("display", "none");
		 $("#autoLiSetting").css("display", "none");
	 }
	
});

function setAuto(){
	if($("#isOpen").html() == "开启自动打印订单"){
		$("#isOpen").html("关闭自动打印订单");
		
		seajs.use(['autoPrint.js'],function(auto){
			//自动打印订单
			auto.init(auto);	
		});
	}else{
		$("#isOpen").html("开启自动打印订单");
		
		seajs.use(['autoPrint.js'],function(auto){
			auto.clear();	
		});
	}
}
function setPrintType(t,txt){
	seajs.use(['autoPrint.js'],function(auto){
		//自动打印订单
		if(t!=""){
			auto.setPrintType(t);	
			$("#_print_type_").text(txt);
		}
	});
}

//调转到供应商商城
function gotoSCM(){
	var host = window.location.host;
  	if(host.indexOf("storeme.cn")>=0){
		get2post("http://www.storeme.cn/scm/v1/pages/shop/supplier.jsp?mobile=${sessionScope._SESSION_USER_.userName}&pwd=${sessionScope._SESSION_USER_.pwd}&shopId=1","_blank");
  	}else if(host.indexOf("localhost")>=0){
		get2post("http://localhost:7080/scm/v1/pages/shop/supplier.jsp?mobile=${sessionScope._SESSION_USER_.userName}&pwd=${sessionScope._SESSION_USER_.pwd}&shopId=1","_blank");
  	}else {
		get2post("http://120.27.46.32:8082/scm/v1/pages/shop/supplier.jsp?mobile=${sessionScope._SESSION_USER_.userName}&pwd=${sessionScope._SESSION_USER_.pwd}&shopId=1","_blank");
  	}
  	
  	
}
</script>

</body>
</html>